<?php $this->load->view('_header') ?>
<script language="javascript" type="text/javascript" src="<?php echo site_url('js/formValidator_min.js')?>"></script>
<script language="javascript" type="text/javascript" src="<?php echo site_url('js/formValidatorRegex.js')?>"></script>
<div class="Main">
	<?php
	echo form_open("user/doregister",array('id' => 'formregister'));
	?>
	<table width=854 style="margin:5px">
		<tr height=52><td colspan=3 class="regtitle" style="padding-left:35px" ><?=lang("register_now")?></td></tr>
		<tr><td colspan=3 ><div class="onError"><span id="cvlRegister" style="color: Red; display: none;">注册信息错误</span></div></td></tr>
		<tr height=36>
			<td width=156 align="right" >*<?=lang("r_Username")?>:&nbsp;&nbsp;</td>
			<td width=200 ><input type=text id="txuseraccount" name="useraccount" class="txd" /></td>
			<td width=420 ><div id="txuseraccountTip"></div></td>
		</tr>
		
		<tr height=36>
			<td width=156 align="right" >*<?=lang("r_Password")?>:&nbsp;&nbsp;</td>
			<td><input type="password" id="txuserpassword" name="userpassword" class="txd" /></td>
			<td><div id="txuserpasswordTip"></div></td>
		</tr>
		
		<tr height=36>
			<td width=156 align="right" >*<?=lang("r_ConfirmPassword")?>:&nbsp;&nbsp;</td>
			<td><input type="password" id="txconfirmpassword" name="confirmpassword" class="txd" /></td>
			<td><div id="txconfirmpasswordTip"></div></td>
		</tr>
		
		<tr height=36>
			<td width=156 align="right" >*<?=lang("r_Name")?>:&nbsp;&nbsp;</td>
			<td ><input type=text id="txusername" name="username" class="txd" /></td>
			<td><div id="txusernameTip"></div></td>
		</tr>
		
		<tr height=36>
			<td width=156 align="right" ><?=lang("r_Birthday")?>:&nbsp;&nbsp;</td>
			<td ><input type=text id="txbirthday" name="birthday" class="txdatec" /></td>
			<td ></td>
		</tr>
		
		<tr height=36>
			<td width=156 align="right" ><?=lang("r_Tel")?>:&nbsp;&nbsp;</td>
			<td ><input type=text id="txtel1" name="tel" class="txd" /></td>
			<td ><div id="txtel1Tip"></div></td>
		</tr>
		
		<tr height=36>
			<td width=156 align="right" ><?=lang("r_Mobile")?>:&nbsp;&nbsp;</td>
			<td ><input type=text  id="txmobilephone" name="mobilephone" class="txd" /></td>
			<td ><div id="txmobilephoneTip"></div></td>
		</tr>
		
		<tr height=36>
			<td width=156 align="right" ><?=lang("r_Address")?>:&nbsp;&nbsp;</td>
			<td ><input type=text name="address" class="txd" /></td>
			<td ></td>
		</tr>
		
		<tr height=36>
			<td width=156 align="right" >Email:&nbsp;&nbsp;</td>
			<td ><input type=text name="email" id="txemail" class="txd" /></td>
			<td ><div id="txemailTip"></div></td>
		</tr>
		
		<tr height=36>
			<td></td>
			<td><input type="submit" name="bbb" id="ibtRegister" class="btn3" value="<?=lang("r_Register")?>" /></td>
			<td ></td>
		</tr>
		
	</table>
	<?php
	echo form_close();
	?>
	<script language="javascript">
	

	$('#txbirthday').datepick();
	$.formValidator.initConfig({formid:"formregister",onerror:function(msg){alert(msg)}});
	$("#txuseraccount").formValidator({onshow:"<?=lang('r_info1')?>",onfocus:"<?=lang('r_info2')?>",oncorrect:"The user name can register"}).inputValidator({min:5,max:10,onerror:"You enter the user name is illegal, please confirm"}).regexValidator({regexp:"username",datatype:"enum",onerror:"User name format is not correct"});
	$("#txuseraccount").ajaxValidator(
	{
		type: "GET",
		url: '<?php echo site_url('user/check_username')?>',
		datatype: "json",
		success:
			function(result)
			{
				return result.Result;
			},
		buttons: $("#ibtRegister"),
		onwait: "User name is now testing whether repeated ...",
		onerror: "The user name has been used"
	});
	$("#txusername").formValidator({onshow:"Please enter your user name ",onfocus:"",oncorrect:""}).inputValidator({min:1,max:100,onerror:"You enter the user name is illegal, please confirm"});
	$("#txuserpassword").formValidator({onshow:"<?=lang('r_info3')?>",onfocus:"Password can't for empty",oncorrect:"Password legal"}).inputValidator({min:4,empty:{leftempty:false,rightempty:false,emptyerror:"Password both sides can't free symbols"},onerror:"The password can't for empty, please confirm"});
	$("#txconfirmpassword").formValidator({onshow:"<?=lang('r_info4')?>",onfocus:"The same password twice",oncorrect:"Password consistent"}).inputValidator({min:4,empty:{leftempty:false,rightempty:false,emptyerror:"Repeat the password both sides can't free symbols"},onerror:"Repeat the password can't for empty, please confirm"}).compareValidator({desid:"txuserpassword",operateor:"=",onerror:"2 times password is not consistent, please confirm"});
	
	$("#txemail").formValidator({onshow:"Please enter the E-mail",onfocus:"Mailbox at least six characters, most 100 characters",oncorrect:"",defaultvalue:""}).inputValidator({min:6,max:100,onerror:"You input Email illegal, please confirm the length"}).regexValidator({regexp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onerror:"You enter the Email format is not correct"});
	//$("#txmobilephone").formValidator({empty:true,onshow:"请输入你的手机号码，可以为空哦",onfocus:"你要是输入了，必须输入正确",oncorrect:"谢谢你的合作",onempty:"你真的不想留手机号码啊？"}).inputValidator({min:11,max:11,onerror:"手机号码必须是11位的,请确认"}).regexValidator({regexp:"mobile",datatype:"enum",onerror:"你输入的手机号码格式不正确"});;
	//$("#txtel1").formValidator({empty:true,onshow:"请输入你的联系电话，可以为空哦",onfocus:"格式例如：0577-88888888",oncorrect:"谢谢你的合作",onempty:"你真的不想留联系电话了吗？"}).regexValidator({regexp:"^[[0-9]{3}-|\[0-9]{4}-]?([0-9]{8}|[0-9]{7})?$",onerror:"你输入的联系电话格式不正确"});
	</script>
</div>

<?php $this->load->view('_footer') ?>